package com.ftg.shopping.mulu.mapper;

import com.ftg.shopping.config.LayuiPage;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

@Mapper
public interface muluMapper {

    @Select("SELECT DISTINCT c.* FROM sp_userprivilege_mid a LEFT JOIN sp_roleprivilege_mid b ON a.roleid = b.roleid LEFT JOIN sp_privilegeinfo c ON b.privilegeid = c.privilegeid WHERE c.parentid = 1 AND userid= #{userid}")
    List<Map<String,Object>> showForPara1(int userid);

    @Select("select privilegename title,linkurl href,a.privilegeid from sp_privilegeinfo a LEFT JOIN sp_roleprivilege_mid b ON a.privilegeid = b.privilegeid LEFT JOIN sp_userprivilege_mid c ON b.roleid = c.roleid WHERE a.parentid = #{id} AND c.userid = #{userid}")
    List<Map<String,Object>> showForPara2(int id, int userid);
}
